package com.chixing.server.sender;

import com.chixing.service.EmailService;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class SenderFirstMessage {
    @Autowired
    private RabbitTemplate rabbitTemplate;
    @Autowired
    private EmailService emailService;
    public void send(String context) { //注意因为是AmqpTemplate，所有这里只接受String,byte[],Seriz..
        System.out.println("SenderFirstMessage : " + context);

        this.rabbitTemplate.convertAndSend("RemindFirstToReturnTheCarExchange","RemindFirstToReturnTheCarRouting", context);
    }

}

